<template>
  <div class="box">
    <h1>Child2</h1>
    <button @click="sendData">发送数据</button>
  </div>
</template>

<script>
// 导入
import Pubsub from 'pubsub-js'
export default {
  name: 'Child2',
  methods: {
    sendData() {
      // 发送数据
      Pubsub.publish('abc', 33)
    }
  }
}
</script>

<style scoped></style>
